package SellCar.service.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

import SellCar.dao.buy.BuyMapper;
import SellCar.dao.buy.impl.BuyMapperImpl;
import SellCar.pojo.Buy;
import SellCar.service.BuyBiz;
import SellCar.utils.MyBatisUtil;
@Service("buyBizImpl")
public class BuyBizImpl implements BuyBiz{
	@Autowired
	@Qualifier("buyMapperImpl")
	private BuyMapperImpl buyMapper;
	
	public List<Buy> getBuyList() {
		return buyMapper.getBuyList();
	}
	
	//通过车名查出车的信息
	public List<Buy> getCarInfo(String CarName) {
		return buyMapper.getCarInfo(CarName);
	}
	
	/*@Test
	public void test(){
		ApplicationContext ap = new ClassPathXmlApplicationContext("applicationContext.xml");
		BuyBizImpl buyBizImpl = (BuyBizImpl) ap.getBean("buyBizImpl");
		List<Buy> list = buyBizImpl.getCarInfo("���ӵ�����");
		for (Buy buy : list) {
			System.out.println(buy.getPrice());
		}
	}*/
	
}
